package com.hisense.ovcloud.mqtt.router;

import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.validation.Validator;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
import org.springframework.web.reactive.config.EnableWebFlux;


@SpringBootApplication(scanBasePackages={
        "com.hisense.ovcloud.commons",
        "com.hisense.ovcloud.mqtt.router",
        "com.hisense.ovcloud.commons.configs",
        "com.hisense.ovcloud.commons.configs.*",
        "com.hisense.ovcloud.commons.configs.*.*"
})
@EnableWebFlux
@EnableAsync
@EnableEncryptableProperties
@Slf4j
public class Main implements CommandLineRunner {
    public static void main(String[] args) {
        SpringApplication.run(Main.class, args);
    }

    @Override
    public void run(String... args){

    }

    @Bean
    @Primary
    public Validator springValidator() {
        return new LocalValidatorFactoryBean();
    }

//    @Bean
//    @Primary
//    public QueryWrapper queryWrapper(){
//        return QueryWrapper.create();
//    }

}
